Method for rendering relighted 3d portrait of person and computing device for the same

ABSTRACT

The disclosure provides a method for generating relightable 3D portrait using a deep neural network and a computing device implementing the method. A possibility of obtaining, in real time and on computing devices having limited processing resources, realistically relighted 3D portraits having quality higher or at least comparable to quality achieved by prior art solutions, but without utilizing complex and costly equipment is provided. A method for rendering a relighted 3D portrait of a person, the method including: receiving an input defining a camera viewpoint and lighting conditions, rasterizing latent descriptors of a 3D point cloud at different resolutions based on the camera viewpoint to obtain rasterized images, wherein the 3D point cloud is generated based on a sequence of images captured by a camera with a blinking flash while moving the camera at least partly around an upper body, the sequence of images comprising a set of flash images and a set of no-flash images, processing the rasterized images with a deep neural network to predict albedo, normals, environmental shadow maps, and segmentation mask for the received camera viewpoint, and fusing the predicted albedo, normals, environmental shadow maps, and segmentation mask into the relighted 3D portrait based on the lighting conditions.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of International Application No. PCT/KR2021/012284 designating the United States, filed on Sep. 9, 2021, in the Korean Intellectual Property Receiving Office and claiming priority to Russian Patent Application No. 2020137990, filed Nov. 19, 2020 in the Russian Patent Office and Russian Patent Application No. 2021104328, filed Feb. 19, 2021 in the Russian Patent Office, the disclosures of which are incorporated by reference herein in their entireties.

BACKGROUND Field

The disclosure relates to Artificial Intelligence (AI)-based image processing, and for example, to a method for generating relightable 3D portrait using a deep neural network and a computing device implementing the method.

Description of Related Art

The rise of mobile photography comes hand-in-hand with the pervasiveness of two-dimensional displays. As three-dimensional display devices such as VR headsets, AR glasses, 3D monitors are becoming widespread, expanding mobile photography to 3D content acquisition and processing becomes a demanded field of technology development. Most 3D displays project 3D models into either the user surrounding (AR glasses) or the virtual environment (VR headsets, 3D monitors). Thus, to enhance the realism of such models, the models should be made relightable in a realistic way according to their environment (real or synthetic).

Building realistic relightable 3D models is a far less investigated area of research. Prior art solutions either focus on single-view relightable reconstruction (significantly limiting the quality characteristics of the model that can be obtained), or on the acquisition of relightable models using specialized equipment (light stages). Article titled as “Deep single-image portrait relighting” by H. Zhou, S. Hadap, K. Sunkavalli, and D. W. Jacobs (In Proceedings of the IEEE International Conference on Computer Vision, 2019) and an article titled as “Neural Light Transportfor Relighting and View Synthesis” version 1 (v1) by X. Zhang, S. Fanello, Y.-T. Tsai, T. Sun, T. Xue, R. Pandey, S. Orts-Escolano, P. Davidson, C. Rhemann, P. Debevec, J. Barron, R. Ramamoorthi, W. Freeman (In Proceedings of ACM Transactions on Graphics, August 2020) may be considered as related art.

SUMMARY

Embodiments of the disclosure provide methods, computing devices, and systems for obtaining photorealistic 3D models of human heads or upper bodies (which are referred to as 3D human portraits) from videos captured by conventional cameras of currently available handheld devices with limited resources, e.g. from shots by a smartphone camera.

Referring to various embodiments of the disclosure, the system (the term “system” is used herein interchangeably with the terms “method” and “device” to refer to the combination of features and hardware parts) requires only a video of a person captured by a smartphone camera with interleaved flash and no-flash images (frames). Given such a video, the embodiments of the disclosure may prepare a relightable model and render a relighted 3D portrait of the person from an arbitrary viewpoint. Embodiments of the disclosure may thus be advantageously applied to AR, VR, and 3D display devices.

Embodiments of the disclosure may use neural point-based graphics and 3D point clouds as geometric proxies. The photometric information may be coded in the form of latent descriptors of individual points in the clouds. The points and their latent descriptors may be rasterized for novel camera viewpoints (for example, a viewpoint requested by corresponding manipulations of a user in a VR environment), and the rasterizations may be processed by a trained (e.g., learned) system including, for example, a deep neural network trained (learned) to predict per-pixel albedo, normals (normal directions), environmental shadow maps, and segmentation mask, as observed for the novel camera viewpoint, and render 3D portrait of the person based on the predicted information.

During the scene reconstruction process, the model may be fitted to the video images and auxiliary parameters of the scene lighting and the camera flash are estimated along the way. Human face-specific priors may be used to disentangle scene lighting and albedo factors. While the priors are measured in the facial part of the scene, they facilitate disentanglement across the whole 3D portrait. Once reconstructed, the scene (portrait) may be rendered from new viewpoints and with new lighting at interactive speeds.

According to an example embodiment, a method for rendering a relighted 3D portrait of a person is provided, the method including: receiving an input defining a camera viewpoint and lighting conditions, rasterizing latent descriptors of a 3D point cloud at different resolutions based on the camera viewpoint to obtain rasterized images, wherein the 3D point cloud is generated based on a sequence of images captured by a camera with blinking flash while moving the camera at least partly around an upper portion of the person, the sequence of images comprising a set of flash images and a set of no-flash images, processing the rasterized images with a deep neural network to predict albedo, normals, environmental shadow maps, and a segmentation mask for the received camera viewpoint, and fusing the predicted albedo, normals, environmental shadow maps, and segmentation mask into a relighted 3D portrait based on the lighting conditions.

According to an example embodiment, a computing device is provided, the computing device comprising: a processor and a memory storing processor-executable instructions and weights of a deep neural network, latent descriptors, and auxiliary parameters obtained during a training stage, wherein upon execution of the processor-executable instructions by the processor the processor causes the computing device to carry out a method for rendering a relighted 3D portrait of a person according to the above example method or any further implementation of the above example method.

Example advantages of various example embodiments of the disclosure may include, for example, and without limitation: (1) a neural rendering model that supports relighting and is based on 3D point cloud geometry; and (2) an albedo-lighting disentangling approach utilizing face priors. By combining these, is the disclosed a system is capable of generating realistically relighted 3D portrait of a person based simply on a sequence of images captured by conventional camera, which supports real-time rendering. Thus, embodiments of the disclosure obtain, in real time and on computing devices having limited processing resources, realistically relighted 3D portraits having quality higher or at least comparable to quality achieved by prior solutions, without utilizing complex and costly image acquisition equipment (such as, e.g., light stages). Therefore, a computing device (e.g. smartphone, a tablet, or VR/AR/3D display device/glasses, or a remote server) with the functionality of the claimed system ensures significantly better user experience and improves adoption of VR and AR technologies.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other aspects, features and advantages of certain embodiments of the present disclosure will be more apparent from the following detailed description, taken in conjunction with the accompanying drawings, in which:

FIG. 1 is a diagram illustrating an example of an overall processing pipeline according to various embodiments;

FIG. 2 is a flowchart illustrating an example method for rendering a relighted 3D portrait of a person according to various embodiments;

FIG. 3 is a flowchart illustrating example details of generating a 3D point cloud based on the sequence of images according to various embodiments;

FIG. 4 is a flowchart illustrating an example of the training stage of the system according various embodiments; and

FIG. 5 is a block diagram illustrating an example configuration of an example computing device configured to render 3D portrait of a person according to various embodiments.

DETAILED DESCRIPTION

FIG. 1 is a diagram illustrating an example of an overall processing pipeline according to various embodiments. The illustrated processing pipeline may be implemented fully or partly on currently available computing devices such as, for example, and without limitation, a smartphone, a tablet, VR (Virtual Reality) display device, AR (Augmented Reality) display device, 3D display device, etc. VR, AR, and 3D display devices may, for example, be in the form of smart glasses. When implemented partly, the computationally demanding operations (e.g., operations of training stage) may be performed in the cloud, for example by a server.

For generating a relighted 3D portrait of a person the disclosed system may utilize a sequence of images featuring a person. Such sequence of images may be captured by conventional cameras of currently available handheld devices (e.g. by a smartphone camera). The sequence of images may be provided to the pipeline from user gallery (when access to the gallery is permitted by the user) or downloaded from a web-resource. However, it will be understood that the source of the sequence of images is not limited.

The sequence of images may be captured by a camera with blinking flash while moving the camera at least partly around the person (e.g., partly around an upper body of the person). Thus, the sequence of images comprises a set of flash images and a set of no-flash images. These features facilitate albedo-lighting disentanglement for subsequent lighting modifications including the cases of complete relighting of 3D portrait or partial relighting of 3D portrait according a novel camera viewpoint. Relighting may be performed to completely new lighting conditions, e.g., lighting conditions replacing lighting that took place when capturing the sequence of images with new arbitrary lighting conditions. Relighting may be performed to relight certain parts of 3D portrait by correctly extrapolating lighting that took place when capturing the sequence of images to said parts of 3D portrait.

The sequence of images may be captured with blinking flash using standard functionality of a camera of the computing device or using any available software or an application (e.g. Open Camera app) suitable for image acquisition with blinking flash. The dotted curved line in FIG. 1 illustrates and example trajectory of the camera sweep around, for example, the upper body of a person. The upper body may include, but is not limited to, head, shoulders, arms, and chest of the person. As a non-limiting example, capturing may be made with controlled white balance, 30 FPS, 1/200 s shutter speed and ISO of approximately 200 (to be selected for each sequence according to the lighting conditions). During each recording, the camera flash is blinking, for example, once per second, each time turning on for, for example, 0.1 s. Camera blinking may be regular or irregular. The captured sequence of images preferably cover the entire upper body of a person, for whom the relighted 3D portrait is generated. Each person is photographed for, for example, 15-25 seconds. Particular values are given in this paragraph only as examples and not limitations. Specific values can be selected from the appropriate ranges, for example +/−10-50% from the given particular values.

The person should stand substantially still during the capturing process. For example, it is assumed that the user's head is directed forward and remains substantially motionless throughout the camera sweep during the capturing process. The camera sweep may be performed, for example, by a person herself/himself as a selfie or by a third person. The camera sweep may cover 180° or less around the person, for example from the left side of the upper body through the face side of the upper body to the right side of the upper body or in the opposite direction, but the disclosure is not limited thereto.

A 3D point cloud 10 may be generated based on the sequence of captured images. The 3D point cloud 10 may be generated using, for example, and without limitation, a Structure-from-Motion (SfM) technique or any other known techniques allowing to reconstruct 3D structure of a scene or object based on the sequence of 2D images of that scene or object. Each point in the 3D point cloud 10 may be augmented with latent descriptor, for example, a multi-dimensional latent vector characterizing properties of the point. Latent descriptors may be sampled from a predefined probability distribution, e.g. from a unit elementwise Gaussian, and may later be fitted at the training stage. Each latent descriptor may serve as a memory vector for the deep neural network (also referred to as the rendering network and described in greater detail below) and may be used by the network to infer geometric and photometric properties of each point. The 3D point cloud is generated and camera viewpoints are estimated based on the set of flash images or the set of no-flash images.

Latent descriptors of the generated 3D point cloud may be rasterized at different resolutions according to a requested new camera viewpoint to obtain rasterized images 15. The rasterization may be made using, for example, and without limitation, a Z-buffering technique or any other known techniques allowing to represent images of objects located in 3D space from a particular camera viewpoint. Different resolutions for the rasterization may include, for example, and without limitation, 512×512, 256×256, 128×128, 64×64, 32×32, or the like (during the training stage). During inference, original resolution, e.g. as specified by a user for the new camera viewpoint, may be estimated and a pyramid of rasterizations having gradually decreasing resolutions (for example, 1920×1080, 860×540, 430×270, 215×145, 107×72) may be made. Feeding a rasterization pyramid with different resolutions (from high to low) to the neural network allows the neural network to take into account both the details of the images (from higher resolution rasterization) and the proximity of points to the camera (from lower resolution rasterizations that do not contain “show-throughs” between the projected points of the 3D point cloud surface closest to the camera and points of the far surface of said cloud).

The camera viewpoint may be specified in an input directly, for example, and without limitation, in the form of particular coordinates in AR/VR environment, camera direction, focal length and other camera intrinsic parameters, or indirectly, for example, and without limitation, a touch input to a corresponding viewpoint in AR/VR environment, an input corresponding to a viewpoint based on a position and an orientation of a computing device (e.g. a smartphone, AR/VR smart glasses) used for manipulating in AR/VR environment or for displaying certain information therein.

Neural rendering may be performed. Neural rendering may be performed by processing the rasterized images 15 with, for example, a deep neural network trained to predict albedo, normals, environmental shadow maps, and segmentation mask for the received camera viewpoint. The architecture of the deep neural network may correspond, for example, to the U-Net structure with gated convolutions. The training stage of the disclosed system and the architecture of used deep neural network are described in greater detail below with reference to FIG. 4. Predicted albedo, normals, environmental shadow maps, and segmentation mask are collectively indicated in FIG. 1 with the numeral 20. Predicted albedo describes the spatially varying reflectance properties (albedo ρ(x)) of the head surface (skin, hair, or other parts). Predicted normals contain normal vectors n(x)) of points at the head surface in the world space. Predicted environmental shadow maps are represented by one-channel group that uses the sigmoid non-linearity and corresponds to the grayscale shadowing S∈

^(H×W) caused by the variations in the room lighting and consequently occurring occlusions. Finally, the predicted segmentation mask is represented by one-channel group that also uses the sigmoid non-linearity and defines the segmentation mask M∈

^(H×W), with each pixel containing the predicted probability of the pixel belonging to the head and not the background.

The predicted albedo, normals, environmental shadow maps, and segmentation mask are fused into the relighted 3D portrait 25 according to lighting conditions. Since the originally captured sequence of images comprises the set of no-flash images conveying lighting conditions with which the sequence of images has been captured, the fused 3D portrait may be relighted by completely replacing lighting conditions with which the sequence of images has been captured with new lighting conditions in which the user is interested.

Lighting types may include, but are not limited to, ambient lighting, directional lighting, and spherical harmonics lighting, or the like. Input of lighting conditions may be received in any suitable way. Lighting-related auxiliary parameters may also include, but not limited to, room lighting color temperature C^(room), and flashlight color temperature C^(flash), etc. C^(room) may refer to a color temperature of the shadows in scene lighting (also referred to as room), C^(flash) may refer to an intensity and color temperature of the flash. Both C^(room) and C^(flash) may be represented by vectors of, e.g. 3 numbers common to the entire scene. They are trained (configured) along with the entire system. These parameters will be described in greater detail below. The type of novel lighting required for the user refers to the expression by which the relighted 3D portrait is generated from the predicted per-pixel albedo, normals, environmental shadow maps, segmentation mask, the lighting-related auxiliary parameters and the parameters of novel lighting conditions. This expression is illustrated in FIG. 1 and will be described in greater detail below.

FIG. 2 is a flowchart illustrating an example method for rendering a relighted 3D portrait of a person according to various embodiments. A sequence of images featuring an upper body of the person is captured at S200 by a camera with blinking flash. During the capturing (e.g. photographing or video capturing) the camera may be moved by the person or a third person at least partly around the upper body of the person. The resulting sequence of images comprises a set of flash images and a set of no-flash images.

A 3D point cloud is generated at S205 based on the captured sequence of images. The 3D point cloud may be generated using, for example, Structure-from-Motion (SfM) technique or any other known techniques allowing to reconstruct 3D structure of a scene or object based on the sequence of 2D images of that scene or object. During the training stage that will be described in greater detail below, the method may include augmenting each point in the 3D point cloud 10 with latent descriptor being a multi-dimensional latent vector characterizing properties of the point.

One or more inputs defining a camera viewpoint and/or lighting conditions are received at S210. Latent descriptors of the 3D point cloud, which are previously obtained during the training stage, are rasterized at S215 at different resolutions according to the camera viewpoint to obtain rasterized images. Neural rendering is performed by processing at S220 the rasterized images with a deep neural network to predict albedo, normals, environmental shadow maps, and segmentation mask for the received (e.g., new) camera viewpoint. Before the inference stage the deep neural network is trained as will be discussed in greater detail below with reference to FIG. 4. The relighted 3D portrait is rendered by fusing at S225 the predicted albedo, normals, environmental shadow maps, and segmentation mask into the relighted 3D portrait according to the received lighting conditions.

FIG. 3 is a flowchart illustrating example details of operation S205 of generating the 3D point cloud based on the sequence of images according to various embodiments. Generating the 3D point cloud at S205 may further include estimating S205.1 camera viewpoints with which the sequence of images is captured. The camera viewpoints estimated at step S205.1 may be used for generating the 3D point cloud as well as for training the deep neural network, latent descriptors for the 3D point cloud, and auxiliary parameters during the training stage. The camera viewpoint and the lighting conditions received at S210 (e.g., new or arbitrary camera viewpoint and lighting conditions requested by a user) via the input differ from camera viewpoints estimated at S205.1 and lighting conditions with which the sequence of images is captured (e.g., current camera viewpoints and lighting conditions during capturing). Estimating camera viewpoints at S205.1 may be performed using, for example, SfM. Points of the originally generated 3D point cloud at least partly corresponding to an upper body of the person.

Generating S205 the 3D point cloud may further include actually generating a dense 3D point cloud at S205.2, processing each image of the sequence by segmenting at S205.3 a foreground and filtering at S205.4 the 3D point cloud based on the segmented foreground by a segmentation neural network to obtain the filtered 3D point cloud. 3D point cloud 10 generated as the result of processing at S205.3 and S205.4 may only include points of the upper body of the person (e.g., points related to background may be excluded). The segmentation neural network may, for example, include a deep neural network that receives an image and produces a per-pixel segmentation mask with real values between 0 and 1. For a given threshold scalar value between 0 and 1, all values in the mask below the threshold are considered background, and the rest are considered foreground (the object). Such a network can be e.g. trained using a large collection of images and corresponding masks with a loss function that penalizes for divergence of predicted mask from ground truth mask. The segmented foreground may be estimated for each image of the captured video, and for each of the images and corresponding camera viewpoints, a 3D frustum may be constructed by casting rays from the camera through pixels that belong to the segmented foreground. Points of 3D point cloud that do not belong to the intersection of the frustums are filtered out, and thus, the filtered 3D point cloud is constructed.

Such segmenting and filtering can improve the quality characteristics of the generated 3D portrait by improving the accuracy of albedo, normals, environmental shadow maps, and segmentation mask predictions 20 performed by the deep neural network.

FIG. 4 is a flowchart illustrating an example of the training stage of the system according to various embodiments. Training may be performed on the same computing device 50 (see FIG. 5), on which the relighted 3D portrait is rendered or outside the device, for example on a server (not shown). If the training is performed on the server, the sequence of images captured at S200 and all the other information used herein as the training information may be transmitted to the server. The server may perform the training as well as any training data conditioning operations as disclosed herein and transmit the trained deep neural network, latent descriptors of the 3D point cloud, and auxiliary parameters back to the computing device for use at inference stage. For this, the computing device may include a communication unit (e.g., including communication circuitry). Training may be performed iteratively, a single iteration is illustrated in FIG. 4. Before the start of training weights and other parameters of the deep neural network, values of latent descriptors, values of auxiliary parameters may be initialized randomly. Auxiliary parameters may include, for example, and without limitation, one or more of room lighting color temperature, flashlight color temperature, and albedo half-texture.

An image and a camera viewpoint corresponding to the image are randomly sampled at S100 from the captured sequence of images. A predicted image (e.g., predicted albedo, normals, environmental shadow maps, and segmentation mask) for the camera viewpoint is obtained at S105 by the deep neural network. Auxiliary face meshes with corresponding texture mapping are predicted at S110 by a 3D face mesh reconstruction network for each of the images (or frames) in the captured sequence, including the image randomly sampled at S100. The corresponding texture mapping may include a specification of two-dimensional coordinates in the fixed, predefined texture space for every vertex of the mesh. 3D face mesh reconstruction network may include a deep neural network that predicts a triangular mesh of the face found on an input image that is aligned with the face on the input image. Such a network can be trained via various supervised, self-supervised, or unsupervised approaches. Non-limiting examples include PRNet model and 3DDFA_v2 model.

A median reference texture is obtained at S115 by calculating a pixel-wise median of all images from the set of flash images resampled to the texture space by the bilinear interpolation. Texture space may, for example, be a rectangle on a 2D plane, where each point has fixed semantics related to the facial region (e.g. a point (0.3, 0.3) might always correspond to the left eye, and point (0.5, 0.5) might always correspond to the tip of the nose). The more precise is the prediction of the auxiliary face mesh with texture mapping, the closer the predicted two-dimensional coordinates of each mesh vertex are to their corresponding semantics in the texture space. The auxiliary face meshes predicted at S110 are rasterized at S120 using color-coding vertices of the face mesh with their geometric normals and Z-buffering. Color-coding vertices with their geometric normals is a process of assigning R, G, B color channels for each point to X, Y, Z coordinates of a normal vector in that point, respectively. Then, the assigned RGB colors are rasterized via Z-buffering.

Loss is calculated at S125 based, for example, and without limitation, on a combination of one or more of the following losses: main loss, segmentation loss, room shading loss, symmetry loss, albedo color matching loss, normal loss. The main loss may be calculated as a mismatch between the predicted image (from S105) and the sampled image (from S100) by a combination of non-perceptual and perceptual loss functions. The segmentation loss may be calculated as a mismatch between the predicted segmentation mask and the segmented foreground. Room shading loss may be calculated as a penalty for the sharpness of the predicted environmental shadow maps, wherein the penalty increases as the sharpness increases. The symmetry loss may be calculated as a mismatch between the mirrored albedo half-texture and the predicted albedo (from S105) resampled in the texture space by the bilinear interpolation.

The albedo color matching loss may be calculated as a mismatch between the median reference texture (from S115) and the predicted albedo (from S105) resampled in the texture space by the bilinear interpolation. The normal loss may be calculated as a mismatch between the predicted normals (from S105) and rasterized images (from S120) of the auxiliary face mesh corresponding to the sampled image. Once the loss is calculated at S125, the loss is backpropagated at S130 to weights of the deep neural network, latent descriptors, and auxiliary parameters. In other words, weights of the deep neural network, latent descriptors, and auxiliary parameters are updated based on the loss calculated at S125. A next iteration may be performed starting again from S100. The deep neural network is trained for a fixed (predetermined) number of iterations (80,000 iterations in the non-limiting example).

For a given point x in a space which belongs to the surface of a volumetric object, the level of radiance of the light emitted at the location x in direction ω_(o) is commonly described by the rendering equation:

$\begin{matrix} {{{L_{o}\left( {x,\omega_{o}} \right)} = {\int\limits_{S}{{f_{r}\left( {x,\omega_{i},\omega_{o}} \right)}{L\left( {x,\omega_{i}} \right)}{{v\left( {x,\omega_{i}} \right)} \cdot \left( {{- \omega_{i}},{n(x)}} \right)}d\;\omega_{i}}}},} & (1) \end{matrix}$

where L_(i)(x,ω_(i)) defines the incoming radiance to x in direction ω_(i),S stands for the upper hemisphere with respect to the surface tangent plane at x with the unit normal n(x). Also, ƒ_(r)(x,ω_(i),ω_(o)) is a ratio of scattered light intensity in the direction ω_(o) and the incoming at direction ω_(i), which is usually referred to as the bidirectional reflectance distribution function (BRDF). Furthermore, is a visibility term (equals to 1 if a point x is reachable by the light from direction ω_(i), or 0 if there is an occlusion in that direction), and L_(o)(x,ω_(o)) defines the total radiance coming from x in direction ω₀. In terms of this model, BRDF is a material property that describes its spatially-varying light scattering properties. Since captured are images that are RGB images, values L_(o)(x,ω_(o)), L_(i)(x,ω_(i)), ƒ_(r)(x,ω_(i),ω_(o)) are all in

³, with each component (channel) calculated independently.

According to an example embodiment, the person (the subject) is captured using a set of images taken with an environment lighting, and another set images in the same environment additionally lighted by a camera flash. As described above blinking flash may be used. To model these two sets of images, the incoming radiance may be decomposed with visibility into two terms:

L _(i)(x,ω _(i))υ(x,ω _(i))=L _(i) ^(room)(x,ω _(i))υ^(room)(x,ω _(i))+F·L _(i) ^(flash)(x,ω _(i))υflash(x,ω _(i)),  (2)

where L_(i) ^(room)(x,ω_(i)) stands for the environmental (room) light, L_(i) ^(flash)(x,ω_(i)) stands for the flash light, and F indicated if the photo is taken with the flash turned on (F=1) or turned off (F=0). Here, υ^(room) and υ^(flash) model the light occlusion for environmental and the flash lighting respectively.

It is further assumed that the BRDF is Lambertian (e.g., constant at each point) ƒ_(r)(x,ω_(i),ω_(o))=ρ(x) (with the normalizing constant omitted), e.g., corresponds to a diffuse surface, and p(x) stands for the surface albedo at x. It is noted that with the neural rendering, the system can model some amount of non-Lambertian effects since the albedo in the model can be effectively made view-dependent. Applying the modifications to (1) to get the following:

$\begin{matrix} {{L_{o}\left( {x,\omega_{o}} \right)} = {{{\rho(x)}{\int\limits_{S}{{L_{i}^{room}\left( {x,\omega_{i}} \right)}{{v^{room}\left( {x,\omega_{i}} \right)} \cdot \left( {{- \omega_{i}},{n(x)}} \right)}d\;\omega_{i}}}} + {{F \cdot {\rho(x)}}{\int\limits_{S}{{L_{i}^{flash}\left( {x,\omega_{i}} \right)}{{v^{flash}\left( {x,\omega_{i}} \right)} \cdot \left( {{- \omega_{i}},{n(x)}} \right)}d\;{\omega_{i}.}}}}}} & (3) \end{matrix}$

Suppose now that the integral in the first part is equal to s(x)∈

³ and defines the shadowing caused both by the room lamps and occlusions (e.g. a nose casting shadow on a cheek, in case of a human head). The shadowing may be modelled as a product of color temperature and grayscale shadowing s(x)=C^(room), s(x), C^(room)∈

³, s(x)∈

. As for the second (flash) part, the incoming light radiance is modeled explicitly as

${{L_{i}^{flash}\left( {x,\omega_{i}} \right)} = \frac{C^{flash}}{{d(x)}^{2}}},$

where d(x) is the distance from the flash to x, and C^(flash)∈

³ is a constant vector proportional to the color temperature and intensity of the flash. It is assumed that the flash is far enough, and hence, d(x)≈d, with d being the distance from the camera to its closest point in the 3D point cloud, and the light rays from the flash are approximately parallel. Since on a smartphone, flashlight and the camera lens are usually co-located at close proximity (at ω_(o)), it is assumed that υ^(flash)(x,ω_(i))=1 for all x observed in a flash image (flashlighted image). Based on that the transformation of (3) into (4) may be performed:

$\begin{matrix} {{L_{o}\left( {x,\omega_{o}} \right)} = {{{\rho(x)}C^{room}{s(x)}} + {{F \cdot {\rho(x)}}\frac{C^{flash}}{d^{2}}\left( {{n(x)},{- \omega_{o}}} \right)}}} & (4) \end{matrix}$

Note that in (4), the decomposition of the light intensity L_(o)(x,ω_(o)) into separate components is ambiguous, as is common to most lighting-albedo estimation problems. In particular, there is an inverse proportional relationship between p(x) and both C^(room) and C^(flash). This ambiguity is resolved in the disclosure using appropriate priors as described in details below in the «Model fitting» section.

After describing the lighting model, geometric modeling is described. It is assumed that

={(I₁, . . . , I_(P)}, I_(k)∈

^(H×W×z), is a sequence of images of an upper body of a person, all taken by a smartphone camera in the same environment and featuring the upper body, including a head of the person, from various angles. A set of flash images is

={I_(s) ₁ , . . . , I_(s) _(M) }, e.g., this set comprises photos featuring the upper body of the person additionally illuminated with a camera flash. Structure-from-Motion (SfM) techniques may be used to estimate (reconstruct) camera viewpoints C₁, . . . , C_(P) of each image:C_(k)={K_(k),|R_(k),t_(k)|}. Then, a 3D point cloud P={p₁, . . . , p_(N)}, p_(i)={x_(i),y_(i),z_(i)} from all images is estimated (reconstructed) similarly. Any known method or software including SfM may be employed for 3D point cloud estimation.

Since the person is modeled without background, a foreground is segmented at S205.3 and the 3D point cloud is filtered at S205.4 based on the segmented foreground by a segmentation neural network to obtain the filtered 3D point cloud. As the example, and not the limitation, U²−Net segmentation network designed for a salient object segmentation task may be used as the segmentation neural network. The pretrained U²−Net model may be additionally fine-tuned with warm-up training schedule on, for example, the Supervisely human segmentation dataset to make it more suitable for present task. After that, images

are passed through the fine-tuned segmentation neural network and the sequence of initial ‘soft’ masks

^(o)={M_(i) ^(o), . . . ,M_(p) ^(o)},M_(k) ^(o) ∈

^(H×W×1) is obtained. M-view consistency of the silhouettes may be achieved via visual hull estimation using the 3D point cloud as a geometric proxy, and using the weights of the segmentation neural network as a parameterization. This is performed by fine-tuning the weights of the segmentation neural network to minimize and/or reduce the inconsistency of segmentations across the views, which results in obtaining the refined masks

={M₁, . . . ,M_(p)},

Neural rendering is based on a deep neural network predicting albedo, normals, and environmental shadow maps from the 3D point cloud rasterized onto each camera view. Each point in the 3D point cloud is augmented with latent (neural) descriptor, e.g., a multi-dimensional latent vector characterizing point properties:

={d₁, . . . , d_(N)},d_(k) ∈

^(L) (L ma be equal to 8, but without the limitation).

The neural rendering stage then starts with the rasterization of the latent descriptors onto the canvas associated with the camera C_(k). This may be performed as follows: the raw image (rasterized image) S[0]=S[0](

_(k))∈

^(H×W×L) is formed by Z-Buffering the 3D point cloud (for each pixel, finding the closest point to the camera which projects to this pixel). The latent descriptor of each of the closest points is assigned to the respective pixel. In case there are no point which project to some pixel, a null descriptor is assigned to that pixel instead. Similarly, a set of auxiliary raw images S[1], . . . ,S[T] of spatial sizes

$\frac{H}{2^{2}} \times \frac{W}{2^{2}}$

is constructed and the rasterization of latent descriptors is performed onto these images by the same algorithm. A pyramid of the raw images is introduced to cover the 3D point cloud at several scales (resolutions). The highest resolution raw image S[0] features the richest spatial detail, while the lower resolution ones feature less surface bleeding.

The set of raw images S[0], . . . ,S[T] is processed the deep neural network ƒ_(ϕ)(S[0], . . . , S[T] closely following the U-Net structure with gated convolutions. Each of the raw images may be passed as an input (or concatenated) to the first layer of the network encoder of the respective resolution. The output of the deep neural network is the set of dense maps. These maps may contain output RGB values.

The overall processing pipeline according to various embodiments is outlined in FIG. 1. The last layer of the deep neural network may output an eight-channel tensor with several groups:

-   -   The first group contains three channels and uses sigmoid         non-linearity. These channels contain the albedo values A ∈         ^(H×W×3). Each pixel of A describes the spatially varying         reflectance properties (albedo ^(κ(x))) of the head surface         (skin, hair, or other parts).     -   The second group also has three channels, and uses groupwise L₂         normalization in the end. This group contains the rasterized         normals N ∈R^(H×W×3), with each pixel containing a normal vector         n(x) of the point at the head surface in the world space.     -   One-channel group that uses the sigmoid non-linearity,         corresponds to the grayscale shadowing S ∈R^(H×W), caused by the         variations in the room lighting and consequently occurring         occlusions.     -   The last one-channel group that also uses the sigmoid         non-linearity, defines the segmentation mask M ∈R^(H×W), with         each pixel containing the predicted probability of the pixel         belonging to the head and not the background.

Given the output of the deep neural network, the final rendered image (e.g., the relighted 3D portrait) is defined by fusing the albedo, normals, and environmental shadow maps, and segmentation mask as prescribed by the lighting model (4) (e.g., according to the lighting conditions):

$\begin{matrix} {{\mathcal{I} = {{A \cdot C^{room} \cdot S} + {{F \cdot A}\frac{C^{flash}}{d^{2}}\left( {N,{- \omega_{o}}} \right)}}},} & (5) \end{matrix}$

where the scalar product (N_(i)−ω_(o)) is applied to each pixel. The color temperature vectors C^(room) and C^(flash) both in R³ are considered part of the model and are shared between all pixels. These vectors may be estimated from training data as discussed below. At the inference time, feature maps A and N, as well as C^(room), C^(flash) parameters, can be used to render the person upper body under a different modified lighting, such as directional lighting (

=A·[(N,−ω)]) or other models such as spherical harmonics (SH). In the latter case, the albedo A is multiplied by a non-linear function of the pixel normals N that incorporates the SH coefficients. When a 360° panorama of a new environment is available, one can obtain the values of the SH coefficients (up to the predefined order) by the panorama integration. It is known that choosing the order of 3 or higher, which results in at least 9 coefficients per color channel, can often yield the expressive lighting effects. In case of the third order SH, the relighted image may be defined as a quadratic form:

[i,j]=

[i,j]·[N[i,j]1^(T) ·M(SH _(coef))·[N[i,j]1],  (6)

where the 4×4 matrix M(SH_(coef)) linearly depends on the 27 SH coefficients SH_(coef).

The model contains a large number of parameters that are fitted to the data. During fitting, the obtained images ^(I) (5) are compared with the ground truth images I^(gt) by a loss constructed as a combination from one or more components that are described below.

The main loss equals to the evaluated mismatch between the predicted image ^(I) and the ground truth image I^(gt):

L _(flash)(ϕ,

,C ^(room) ,C ^(flash))=Δ(I(ϕ

,C ^(room) ,C ^(flash)),I ^(gt))  ,(7)

where the mismatch function Δ is employed to compare pair of images:

Δ(I ₁ ,I ₂)=VGG(I ₁ ,I ₂)+β·L ₁(pool_(k)(I ₁,pool_(k)(I ₂))  (8)

Here, VGG(·,·) is a perceptual mismatch based on the layers of VGG-16 network, L₁(·,·) refers to the mean absolute deviation, pool_(k)(I) is the average pooling of an image ^(I) with K×K kernel (K may be equal to 4, but without the limitation) and β is a balancing coefficient introduced to equalize the range of values of two terms (as the example, β may be equal to 2500). While VGG encourages matching of high-frequency details, L₁ rewards matching colors. Since naive optimization of L₁ can lead to blurring and loss of details, the L₁ term may be evaluated over the downsampled images.

Since it is required from the proposed method to segment the rendered head from an arbitrary viewpoint, the segmentation loss constraining the predicted mask M may be introduced:

L _(mask)(ϕ,

)=−log Dice(M(ϕ,

,M ₁),  (9)

where the Dice function is a common choice of the mismatch for segmentation (evaluated as the pixel-wise F1 score). Effectively, with this loss, the deep neural network trains to extrapolate the pre-calculated masks M to new viewpoints.

For no-flash images, the rendered image is equal to I=A·C^(room)·S according to (5). In practice, this creates a certain ambiguity between the learned maps A and S. Since A participates in both terms of (5), the high-frequency component of the renderings tends to be saved in S by default. The following room shading loss implicitly requires A to be fine-grained instead:

L _(TV)(ϕ,

)=TV(S(ϕ,D))  (10)

where TV is a Total Variation loss based on L1.

To further regularize the training process, the particular property of the scenes, namely the presence of the face regions, may be used. For that, for each training image, face alignment is performed using a pretrained 3D face mesh reconstruction network. Known PRNet system, but without the limitation, may be used as the 3D face mesh reconstruction network. Given an arbitrary image ^(I) containing a face, the 3D face mesh reconstruction network may estimate a face alignment map, e.g., a tensor Posmap of size 256×256 (the particular size is indicated as the example, and not the limitation) that maps the UV coordinates (in a predefined, fixed texture space associated with the human face) to the screen-space coordinates of the image ^(I).

Let Posmap₁, . . . , Posmap_(P) define the position maps calculated for each image in the training sequence. The bilinear sampling (backward warping) of an image ^(I) onto Posmap is denoted by the operation I⊙Posmap, which results into mapping the visible part of ^(I) into the UV texture space. The mapping thus constructs a colored (partial) face texture.

The gathered face geometry data are employed in two ways. First, throughout the fitting an albedo half-texture

_(A) of size 256×128 (for the left or right part of the albedo) is estimated. The particular size (256×128) is given as the example, and not the limitation. The albedo half-texture T_(A) is initialized by taking a pixel-wise median of projected textures for all flash images T_(p)=median(I_(s1)⊙Posmap₁, . . . ,I_(M)⊙Posmap_(M)) and averaging left and flipped right halves or right and flipped left halves. The symmetry loss is a facial prior that encourages the symmetry of albedo by comparing it with the learned albedo texture:

L _(symm)(ϕ,D,TA)=Δ(A(ϕ,D)⊙Posmap[,T _(A),flip(T _(A))])  (11)

(the mismatch function is evaluated only where A(ϕ,D)⊙Posmap_(i) is defined).

[T_(A), flip(T_(A))] flip(T) denotes the concatenated texture and its horizontally flipped version. This loss both makes albedo more symmetric and matches albedo texture T_(A) colors with the ones of the learned albedo. The balance between these two factors is controlled by the learning rate for T_(A). In the disclosure, the symmetry loss helps resolving the decomposition of an image into albedo and shadows, as the opposite points of the face (e.g. left and right cheeks) can have similar albedo, while casted shadows are most often non-symmetric.

To select the gamma for albedo, the albedo color matching loss may be introduced L_(m)(ϕ,

)=L₁(A(ϕ,D)⊙Posmap_(i),

)(also calculated only for valid texture elements of A(ϕ,D)⊙Posmap₁).

Another type of data which can be inferred from the 3D face mesh reconstruction network (e.g. PRNet) outputs is the normals for the face part. Each face alignment map, along with the estimated depth (also by PRNet) and a set of triangles, defines a triangular mesh. The meshes estimated for each view are rendered and smoothened, face normals are calculated and the projected normals are rendered onto the respective camera view (technically, all operations may performed, for example, in Blender rendering engine). Then, the rendered normals are rotated by the camera rotation matrix for their conversion to the world space. The notation N₁, . . . , N_(P) is introduced for the estimated normal images for the facial part of size H×W. The normals predicted by the deep neural network are matched with the 3D face mesh reconstruction network (e.g. PRNet) normals at the facial region (defined by the mask M_(ƒ)ac_(e)) by the normal loss:

L _(normal)(ϕ,D)=Δ(N(ϕ,D)·M _(face) ,N _(i) ·M _(face))  (12)

The composite (combined) loss may be expressed as follows:

$\begin{matrix} {{L\left( {\phi,\mathcal{D},C^{room},C^{flash},\mathcal{T}_{A}} \right)} = {{L_{final}\left( {\phi,\mathcal{D},C^{room},C^{flash}} \right)} + {\alpha_{normal}{L_{normal}\left( {\phi,\mathcal{D}} \right)}} + {\alpha_{symm}{L_{symm}\left( {\phi,\mathcal{D},\mathcal{T}_{A}} \right)}} + {\alpha_{cm}{L_{cm}\left( {\phi,\mathcal{D}} \right)}} + {\alpha_{TV}{L_{TV}\left( {\phi,\mathcal{D}} \right)}} + {\alpha_{mask}{L_{mask}\left( {\phi,\mathcal{D}} \right)}}}} & (13) \end{matrix}$

Separate losses may be balanced, for example, as follows: α_(normal)=0.1, a_(symm)=0.02, a_(em)=300, a_(TV)=50, a_(mask)=10³. Other balancing schemes are also possible, e.g. a_(normal)=0.1, a_(symm)=0.02, a_(em)=100, a_(TV)=50,a_(mask)=10³.

The trainable part of the system is trained for one scene by the backpropagation of the loss to the rendering network parameters ϕ, point descriptors D, and to the auxiliary parameters C^(room), C^(flash),

. Adam with the same learning rate for ϕ and D may be used, while the rest of learnable parameters feature different learning rates, empirically selected according to the range of their possible values may be used. At each step, a sample training image is sampled, and a forward pass followed by the gradient step is made. Train-time augmentations may include random zoom in/out and subsequent cropping of a small patch.

FIG. 5 is a block diagram illustrating an example configuration of a computing device 50 configured to render 3D portrait of a person according to various embodiments. The computing device 50 comprises processor (e.g., including processing circuitry) 50.1, camera 50.2 (camera 50.2 is optional; thus in FIG. 5 it is outlined with a dotted line), and memory 50.3 interconnected with each other. Illustration of interconnections between processor 50.1, camera 50.2, and memory 50.3 should not be construed as the limitation, because it is clear that processor 50.1, camera 50.2, and memory 50.3 may be interconnected differently. Camera 50.2 is configured to capture a sequence of images of a person using blinking flash. Memory 50.3 is configured to store processor-executable instructions instructing the computing device 50 to perform any step or substep of the disclosed method, as well as weights of the deep neural network, latent descriptors, and auxiliary parameters obtained during the training stage. The processor 50.1, upon execution of the processor-executable instructions, is configured to cause the computing device 50 to carry out the disclosed method for rendering a relighted 3D portrait of a person.

In an embodiment where the remote server is used for training the disclosed system and processing a sequence of images of a person, the computing device may further include a communication unit (not shown) including various communication circuitry configured to exchange data with a remote server. The data may include a request from the computing device to train the disclosed system and/or process a sequence of images of the person. The data for the remote server may also include the sequence of images captured with blinking flash by the computing device. The data from the remote server may include weights and other parameters of the trained system and/or the relighted 3D portrait of the person. Communication technologies of the communication unit may comprise any known communication technology, e.g. WiFi, WiMax, 4G (LTE), 5G and so on. Communication unit is interconnected with other components of the computing device or may be integrated with the processor (e.g. as SoC).

The computing device 50 may comprise other, not shown components, for example, a screen, a camera, a communication unit (e.g., including communication circuitry), a touch-sensitive panel, keypad, keyboard, one or more buttons, a speaker, a microphone, a Bluetooth module, an NFC module, a RF module, a Wi-Fi module, a power supply and so on, and corresponding interconnections. The disclosed method for rendering a relighted 3D portrait of a person may be implemented on a wide range of computing devices 50, such as, for example, and without limitation, VR smart glasses, AR smart glasses, 3D displaying systems, smartphones, tablets, laptops, mobile robots and navigation systems, or the like. The implementation of the method supports all kinds of devices capable of performing calculations on CPU. Additionally, the computing device 50 may comprise additional components for speeding up the neural network and rasterization, such as, for example, and without limitation, a GPU (graphics processing unit), NPU (neural processing unit), TPU (tensor data processing unit), or the like. OpenGL may be applied for implementation of the rasterization. If such additional components are included, faster and more effective implementation and performance of the disclosed method (including the training stage) is possible on such devices. In non-limiting embodiments the processor 50.1 may implemented including, but not limited to, a general-purpose processor, an application-specific integrated circuit (ASIC), a user-programmable gate array (FPGA), or a system-on-chip (SoC), etc.

At least one of the plurality of modules, blocks, components, steps, sub-steps may be implemented through an AI model. One or more steps or substeps of the disclosed method may be implemented as units/modules (e.g., as hardware components) of the computing device 50. A function associated with AI may be performed through the memory 50.3 that may include non-volatile memory and the volatile memory, and the processor 50.1. The processor 50.1 may include one or a plurality of processors. One or a plurality of processors may comprise a general-purpose processor, such as, for example, and without limitation, a central processing unit (CPU), an application processor (AP), or the like, a graphics-only processing unit such as a graphics processing unit (GPU), a visual processing unit (VPU), and/or an AI-dedicated processor such as a neural processing unit (NPU). The one or a plurality of processors control the processing of the input data in accordance with a predefined operating rule or artificial intelligence (AI) model stored in the non-volatile memory and the volatile memory. The predefined operating rule or artificial intelligence model is provided through training or learning. Being provided through learning may refer to, by applying a learning algorithm to a plurality of learning data, a predefined operating rule or AI model of a desired characteristic being made. The learning may be performed in a device itself in which AI according to an embodiment is performed, and/or may be implemented through a separate server/system.

The AI model may include a plurality of neural network layers. Each layer has a plurality of weight values, and performs a layer operation through calculation of a previous layer and an operation of a plurality of weights. Examples of neural networks include, but are not limited to, convolutional neural network (CNN), deep neural network (DNN), recurrent neural network (RNN), restricted Boltzmann Machine (RBM), deep belief network (DBN), bidirectional recurrent deep neural network (BRDNN), generative adversarial networks (GAN), and deep Q-networks. The learning algorithm is a method for training a predetermined target computing device 50 using a plurality of learning data to cause, allow, or control the target computing device 50 to make a determination, estimation, or prediction. Examples of learning algorithms include, but are not limited to, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning.

Modifications and improvements to the above-described implementations of the various embodiments may become apparent to those skilled in the art. For example, particular parameter values specified in the above disclosure are not to be construed as the limitation, since values of parameters may be selected experimentally from appropriate ranges, for example+/−10-50% from the specified particular parameter values. The foregoing description is intended to be an example rather than limiting.

While the disclosure has been illustrated and described with reference to various example embodiments, it will be understood that the various operations may be combined, sub-divided, or reordered without departing from the teachings of the disclosure. Accordingly, an order and grouping of the operations is not a limitation of the disclosure. The use of the singular form in relation to any element disclosed in this application does not preclude that two or more such elements may be in an actual implementation.

While the disclosure has been illustrated and described with reference to various example embodiments, it will be understood that the various example embodiments are intended to be illustrative, not limiting. It will be further understood by those skilled in the art that various changes in form and detail may be made without departing from the true spirit and full scope of the disclosure, including the appended claims and their equivalents. 

What is claimed is:
 1. A method for rendering a relighted 3D portrait, the method comprising: receiving an input defining a camera viewpoint and lighting conditions, rasterizing latent descriptors of a 3D point cloud at different resolutions based on the camera viewpoint to obtain rasterized images, wherein the 3D point cloud is generated based on a sequence of images captured by a camera with a blinking flash while moving the camera at least partly around an upper body of a person, the sequence of images comprising a set of flash images and a set of no-flash images, processing the rasterized images with a deep neural network to predict albedo, normals, environmental shadow maps, and segmentation mask for the received camera viewpoint, and fusing the predicted albedo, normals, environmental shadow maps, and segmentation mask into a relighted 3D portrait based on the lighting conditions.
 2. The method of claim 1, wherein the generating the 3D point cloud further comprises estimating camera viewpoints with which the sequence of images is captured.
 3. The method of claim 2, wherein the received camera viewpoint and the lighting conditions differ from camera viewpoints and lighting conditions with which the sequence of images is captured.
 4. The method of claim 2, wherein the generating the 3D point cloud and the estimating camera viewpoints are performed using Structure-from-Motion (SfM), wherein the 3D point cloud comprises points at least partly corresponding to an upper body.
 5. The method of claim 1, wherein the generating the 3D point cloud further comprises: processing each image of the sequence by segmenting a foreground; and filtering the 3D point cloud based on the segmented foreground by a segmentation neural network to obtain the filtered 3D point cloud.
 6. The method of claim 1, wherein the rasterizing the 3D point cloud is performed using Z-buffering.
 7. The method of claim 1, wherein flash images of the set of flash images are alternated with no-flash images of the set of no-flash images in said sequence of images.
 8. The method of claim 1, wherein the latent descriptor includes a multi-dimensional latent vector characterizing properties of a corresponding point in the 3D point cloud.
 9. The method of any one of claim 1, wherein the training stage comprises randomly sampling a image from the captured sequence of images, the camera viewpoint corresponding to the image, and obtaining a predicted image by the deep neural network for the camera viewpoint, wherein the training stage is carried out iteratively.
 10. The method of claim 9, wherein the deep neural network is trained by backpropagation of a loss to weights of the deep neural network, latent descriptors, and auxiliary parameters, wherein the loss is calculated based on one or more of: main loss, segmentation loss, room shading loss, symmetry loss, albedo color matching loss, normal loss.
 11. The method of claim 10, wherein the auxiliary parameters include one or more of room lighting color temperature, flashlight color temperature, and albedo half-texture.
 12. The method of claim 11, further comprising predicting auxiliary face meshes with corresponding texture mapping by a 3D face mesh reconstruction network for each of the images in the captured sequence, wherein the corresponding texture mapping includes a specification of two-dimensional coordinates in the fixed, predefined texture space for every vertex of the mesh.
 13. The method of claim 10, wherein the main loss is calculated as a mismatch between predicted image and the sampled image by a combination of non-perceptual and perceptual loss functions.
 14. The method of claim 10, wherein the segmentation loss is calculated as a mismatch between the predicted segmentation mask and the segmented foreground.
 15. The method of claim 10, wherein the room shading loss is calculated as a penalty for the sharpness of the predicted environmental shadow maps, wherein the penalty increases as the sharpness increases. 